function imgPreview(fileDom,imgid){
      var fileSize = 0;
        if (window.FileReader) {
            var reader = new FileReader();
        } else {
            alert("!");
        }

        var warning = document.getElementsByClassName('warning')[0];
        var file = fileDom.files[0];
        var imageType = /^image\//;
            fileSize = file.size;
        var size = fileSize/1024/1024;
        if(size>10){
            warning.style.cssText = "color:red";
            return false;
        }else{
            warning.style.cssText = "color:#333";
        }
        if (!imageType.test(file.type)) {
            alert("图片格式不正确");
            return false;
        }
        reader.onload = function(e) {
         
            var img = document.getElementById(imgid);
            img.src = e.target.result;
        };
        reader.readAsDataURL(file);
    }
